home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-21 | 1.4 KB | 45 lines | [TEXT/PJMM] |
- unit MySystemGlobals;
-
- interface
-
- var { set up by InitSystemGlobals }
- system7: boolean;
- has_appleEvents: boolean;
- has_findfolder: boolean;
- has_aliasMgr: boolean;
- has_newStdFile: boolean;
- has_HelpMgr: boolean;
- has_colorQD: boolean;
- app_resfile: integer;
- app_fs: FSSpec;
-
- procedure InitSystemGlobals;
-
- implementation
-
- {$S Init}
- procedure InitSystemGlobals;
- var
- oe: OSErr;
- gv: longInt;
- pb: FCBPBRec;
- sysenv: sysEnvRec;
- begin
- app_resfile := CurResFile;
- pb.ioNamePtr := @app_fs.name;
- pb.ioVRefNum := 0;
- pb.ioRefNum := app_resfile;
- pb.ioFCBIndx := 0;
- oe := PBGetFCBInfo(@pb, false);
- app_fs.vRefNum := pb.ioFCBVRefNum;
- app_fs.parID := pb.ioFCBParID;
- has_colorqd := (SysEnvirons(1, sysEnv) = noErr) & sysenv.hasColorQD; { Gestalt has a bug that causes hasColourQD to always be set }
- system7 := (Gestalt(gestaltSystemVersion, gv) = noErr) & (gv >= $0700);
- has_AppleEvents := (Gestalt(gestaltAppleEventsAttr, gv) = noErr) & (BTST(gv, gestaltAppleEventsPresent));
- has_findfolder := (Gestalt(gestaltFindFolderAttr, gv) = noErr) & (BTST(gv, gestaltFindFolderPresent));
- has_newStdFile := (Gestalt(gestaltStandardFileAttr, gv) = noErr) & (BTST(gv, gestaltStandardFile58));
- has_HelpMgr := (Gestalt(gestaltHelpMgrAttr, gv) = noErr) & (BTST(gv, gestaltHelpMgrPresent));
- has_aliasMgr := (Gestalt(gestaltAliasMgrAttr, gv) = noErr) & (BTST(gv, gestaltAliasMgrPresent));
- end;
-
- end.